Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete topic #163

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

delete topic #163

wants to merge 5 commits into from

Conversation

petedannemann
Copy link
Contributor

@petedannemann petedannemann commented Nov 9, 2023

Repl has been set to read only mode to prevent accidental deletes, configurable through CLI flag.

Delete operation must be confirmed with a yes/no

Finishing up the great work started in #100

Functional test / demo:

$ go run cmd/topicctl/main.go delete
Deletes instances of a particular type.

Usage:
  topicctl delete [command]

Available Commands:
  topic       Delete a topic

Flags:
  -b, --broker-addr string       Broker address
      --cluster-config string    Cluster config
      --expand-env               Expand environment in cluster config
  -h, --help                     help for delete
      --sasl-mechanism string    SASL mechanism if using SASL (choices: AWS-MSK-IAM, PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512)
      --sasl-password string     SASL password if using SASL; will override value set in cluster config
      --sasl-username string     SASL username if using SASL; will override value set in cluster config
      --tls-ca-cert string       Path to client CA cert PEM file if using TLS
      --tls-cert string          Path to client cert PEM file if using TLS
      --tls-enabled              Use TLS for communication with brokers
      --tls-key string           Path to client private key PEM file if using TLS
      --tls-server-name string   Server name to use for TLS cert verification
      --tls-skip-verify          Skip hostname verification when using TLS
  -z, --zk-addr string           ZooKeeper address
      --zk-prefix string         Prefix for cluster-related nodes in zk

Global Flags:
      --debug        enable debug logging
      --no-spinner   disable all UI spinners

Use "topicctl delete [command] --help" for more information about a command.

$ go run cmd/topicctl/main.go get topics --cluster-config examples/local-cluster/cluster.yaml
[2023-11-09 10:41:13]  INFO Topics:
-----------------+------------+-------------+-----------+------------
       NAME      | PARTITIONS | REPLICATION | RETENTION |   RACKS
                 |            |             |   MINS    | (MIN,MAX)
-----------------+------------+-------------+-----------+------------
  topic-default  | 3          | 2           | 100       | (1,1)
  topic-in-rack3 | 9          | 2           | 100       | (1,1)
  topic-static   | 10         | 2           | 290       | (1,2)
-----------------+------------+-------------+-----------+-----------

$ go run cmd/topicctl/main.go delete topic topic-default --cluster-config examples/local-cluster/cluster.yaml
[2023-11-09 10:41:47]  INFO Checking if topic topic-default exists...
[2023-11-09 10:41:47]  INFO Topic topic-default exists in the cluster!
Delete topic "topic-default" (yes/no) yes
[2023-11-09 10:41:51]  INFO Topic topic-default successfully deleted

$ go run cmd/topicctl/main.go get topics --cluster-config examples/local-cluster/cluster.yaml
[2023-11-09 10:41:56]  INFO Topics:
-----------------+------------+-------------+-----------+------------
       NAME      | PARTITIONS | REPLICATION | RETENTION |   RACKS
                 |            |             |   MINS    | (MIN,MAX)
-----------------+------------+-------------+-----------+------------
  topic-in-rack3 | 9          | 2           | 100       | (1,1)
  topic-static   | 10         | 2           | 290       | (1,2)
-----------------+------------+-------------+-----------+------------

@petedannemann petedannemann requested a review from a team as a code owner November 9, 2023 15:19
@petedannemann petedannemann marked this pull request as draft November 9, 2023 15:24
@petedannemann petedannemann marked this pull request as ready for review November 9, 2023 15:45
@silvadenisaraujo
Copy link

Any chances to keep pushing here @petedannemann ? Looks like it's almost there 🔥

@isaacd9
Copy link

isaacd9 commented Feb 27, 2024

Is there anything blocking merging this? It'd be a huge help in my deployment.

@mvfolino68
Copy link

@petedannemann, checking in on the status of this to see if it's something that you're considering merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants